<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
  
  </div>
  <script src="https://unpkg.com/vue@next"></script>
  <script>
    // 创建一个vue实例
    Vue.createApp({
      data() {
        return {
          count:1,
          list:[],
          inputValue:''
        }
      },
      template:
      ` <button @click='clickCount()'>添加</button>
        <input type="text" v-model="inputValue">
        <div v-for="(item,index) in list" :key="index">{{item}}</div>
      `,
      mounted() {
        // setInterval(() => {
        //   this.count += 1
        // },1000)
      },
      methods:{
        clickCount() {
          this.list.push(this.inputValue)
        }
      }
    }).mount("#app")
  </script>
</body>
</html>